#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QPushButton>
#include "dialog.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QPushButton* button = new QPushButton("弹出一个对话框", this);
    button->move(300, 400);

    connect(button, &QPushButton::clicked, this, &MainWindow::handle);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::handle()
{
    Dialog* my_dialog = new Dialog(this);

    my_dialog->show();
}

